package com.springapp.jsonmodel;

import com.springapp.model.ItemInOrder;

/*
 * 
 * @uthor Sim4ik
 * 
 */

public class ItemInOrderJson {
	
	private Integer id;
	
	private Long count;
	
	public ItemInOrderJson(){}
	
	public ItemInOrderJson(ItemInOrder itemInOrder){
		this.id = itemInOrder.getItem().getId();
		this.count = itemInOrder.getQuantity();
	}
	
	public static ItemInOrderJson toModel(ItemInOrder itemInOrder){
		ItemInOrderJson ioj = new ItemInOrderJson(itemInOrder);
		return ioj;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Long getCount() {
		return count;
	}

	public void setCount(Long count) {
		this.count = count;
	}
	
}
